<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>作业章节详情页</title>
		<script src="../../script/mui.min.js"></script>
	<!--	<script src="../../script/jquery.min.js"></script>
		<script src="../../script/jquery.knob.js"></script>-->
<!--		<link rel="stylesheet" href="../../css/mui.min.css" />-->
		<link rel="stylesheet" href="../../css/timecontrol.min.css" />
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<link rel="stylesheet" type="text/css" href="../../css/attachmentCss.css">
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
		<style>
			body {
				background-color: #FFFFFF
			}
			html {
				background-color: #FFFFFF
			}
			.clearfix {
				content: '';
				display: block;
				clear: both;
			}
			.line_heigt_px {
				line-height: 1.2em;
			}
			.textarea_t {
				height: 120px;
				font-size: 16px;
				font-family: "微软雅黑";
				color: #909090;
				border: 1px solid #d9d9d9;
				line-height: 25px;
				padding: 6px 10px;
			}
			.button_blue {
				background-color: #18B4ED;
				color: #FFFFFF;
				height: 30px;
				padding-right: 5px;
				padding-left: 5px;
				margin-left: 60px;
			}
			.content_div {
				background: #fff;
				padding-left: 10px;
				padding-top: 10px;
				padding-right: 10px;
				margin-top: 66px;
			}
			.div_left_none {
				padding-left: 10px;
				display: none;
			}
			.sore_text_style {
				width: 80px;
				height: 30px;
				color: red;
			}
			.CellFrame {
				float: left;
				position: relative;
				padding-left: 10px;
				padding-top: 10px;
				padding-bottom: 10px;
				width: 30%;
				height: 100px
			}
			.picCell {
				width: 100%;
				height: 100%
			}
		</style>
	</head>
	<body>
	

			<div class="base_style_color" id='BarAppearance' style="height: 22px;width: 100%; position:fixed; left: 0px;top:0px;"></div>
         <div class="base_navigation_bar base_style_color base_navigation_item_bar" style="position: fixed;left: 0px;">
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id='nav_title'>作业</span>
			<a class="base_right_item base_hide_item"   id="bewrite" onclick="openbewrite()">描述</a>
		</div>
		
		<div class="content_div" >
		
			<p class="line_heigt_px letter_lien base_black_grey base_nav_title_font">
				作业内容
			</p>
			<div style="margin-top: 5px;" >
				<p id="content"  class="bottom_10  text_indent_2  base_title_font base_dark_grey" style="word-wrap:break-word;word-break:break-all;">
			<!--作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容-->
				</p>
			</div>
					<!--添加图片！！！！-->
				<div id="addPhoto">
				<!--<div class="CellFrame">
						<img class="picCell" src="../../icon/icon_picAdd.png" >
					</div>-->
					
				</div>
		</div>
		<div  id ="stdfujin" class=" top_10  clearfix  div_left_none " >
			<em class="base_black_grey  base_title_font left" style="margin-top: 3px;" > 附件： </em>
			<em id="stu_attachmentTableView"  class="left" style="width: 84%">
	<!--	<div class="font16"> <a class="a_style_xiazai" >下周完成巍问问周完成巍问问周完成巍问问          <span style="margin-left: 10px;margin-right: 10px;color: #333333;">(16.0M)</span><img  class="img_style_xiazai" src="../../image/doc_icon_studied.png" /></a></div>-->
			</em>
		</div>
		<div class="top_10  clearfix div_left_none  base_title_font "  id="score_div"  >
			<em class="base_black_grey left"> 评分： </em>
			<em  id ="score"  class="sore_text_style">80份</em>
		</div>
		<div class="top_10  div_left_none clearfix  base_title_font" id="comment_div" >
			<em class="base_black_grey left" > 评语： </em>
			<em id="comment"   class= 'base_dark_grey'style="word-wrap:break-word;word-break:break-all;">
				努力努力
			</em>
		</div>
		<div  id ="pizhu" class="top_10  padding_left_10 clearfix div_left_none  " >
			<em class="base_title_font base_black_grey left" style="margin-top: 3px;" > 批注文件： </em>
			<em id="teacher_attachmentTableView" class="left" style="width: 76%" >
		<!--	<div class="font16"> <a class="a_style_xiazai" >下周完成巍问问周完成巍问问周完成巍问问          <span style="margin-left: 10px;margin-right: 10px;color: #333333;">(16.0M)</span><img  class="img_style_xiazai" src="../../image/doc_icon_studied.png" /></a></div>-->
			</em>
		</div>
		<div class="top_10  padding_left_10  clearfix  base_title_font  div_left_none "  id="reject" >
			<em class=" base_black_grey left"> 驳回原因： </em>
			<em id="reject_text" class="base_dark_grey" >
				努力努力
			</em>
		</div>
   
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/timeStampTool.js"></script>
	<script src="../../script/processing_images.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/attachmentManager.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/databaseOperation.js"></script>
	<script type="text/javascript">
		var pageParam ;
		var pid= "";
		var vid= "";
		var uid = "";
		var jid = "";
		var studyid ='';
		var wid ='';
		DBReady = function() {
			setupDownloadAttNotifi();
			showProgress();
			bewrite();
			getpageParamdata();
			getloadData() ;
			sendBuriedNotifi(0, '作业章节详情页', '070');
		};
		
		
		
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
				cid : api.pageParam.cid,
				pid : api.pageParam.pid,
				vid : api.pageParam.vid
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
		
		
		function   bewrite(){
			pageParam = api.pageParam;
		   $('#nav_title').html(pageParam.name);
//		   	var is_dis_bewrite = pageParam.is_dis_bewrite;
//		 
//         if(is_dis_bewrite !="" && is_dis_bewrite!= null && is_dis_bewrite!= undefined){
//			 if(is_dis_bewrite == "1"){
//			   $('#bewrite').removeClass('base_hide_item');
//			   $('#bewrite').addClass('base_visible_item');
//			 }
//			}
		}
			function getpageParamdata(){
	       cid = pageParam.cid,
			vid = pageParam.vid,
			pid = pageParam.pid,
			wid= pageParam.wid,
		   studyid =pageParam. studyid
		
		}
		function iGetInnerText(testStr) {
	        var resultStr = testStr.replace(/\ +/g, ""); //去掉空格
	        resultStr = testStr.replace(/[ ]/g, "");    //去掉空格
	        resultStr = testStr.replace(/[\r\n]/g, ""); //去掉回车换行
	        return resultStr;
	    }
		// 批阅作业
		function getloadData() {
			var params = {
				jid : $api.getStorage('cfnetppjxid'),
//				uid:"11924",
				 uid:$api.getStorage('cfnetppuid'),
				cid :cid,
				vid : vid,
				pid :pid,
				wid: wid,
			   studyid : studyid
			};
			cfnetppPOST(url_getTeacherWorks , params, true, function(data, status) {
	
//				alert(JSON.stringify(data));
				api.hideProgress();
		
				if (status == 'success') {
					if (data.code == 200) {
						var datajson = data.json;
					
						if (datajson != '' ) {
						 
							$('#noData').hide();
							$('#noNet').hide();

							setdata(datajson);
						} else {
							$('#noData').show();
							$('#noNet').hide();
							
						}
					} else if (data.code = 109) {
						$('#noData').show();
						$('#noNet').hide();
						
					} else {
						$('#noData').show();
						$('#noNet').hide();
						
					}
				} else {
					$('#noData').hide();
					$('#noNet').show();
						
							}
							});
							}

		function setdata(data) {
			$('#content').text(removeHtmlTab(escape2Html(data.content)));
			listImg(data.imglist);
			if(data.status == "1"){//驳回
			  $('#reject').show();
			
			  $('#reject_text').text(removeHtmlTab(escape2Html(data.comment)));
			}else{
			  $('#comment_div').show();
			  $('#score_div').show();
			  $('#comment').text(removeHtmlTab(escape2Html(data.comment)));
			  $('#score').text(data.score + "分");
			}							
			if (data.hasOwnProperty('file')) {
				var file = data.file;
				var reg = /[a-zA-Z]/g;
				var attArr = new Array();
				var fid = MD5(file.fileurl);
				fid = fid.replace(reg, "");
				fid = fid.substring(0, 5);
				stuData = {
					id : fid,
					url : file.fileurl,
					size : file.filesize,
					name : file.filename
				};
//				alert(JSON.stringify(stuData));
				$("#stdfujin").show();
				var arr = [];
				arr.push(stuData);
				saveAttDatasToDb(arr, '#stu_attachmentTableView');
			}
		
			var checkfile = data.checkfile;
		
			if (checkfile == "" || checkfile == null) {
				$("#pizhu").hide();
			} else {
		
				$("#pizhu").show();
				var filedes = [];
					filedes = checkfile.split("||");
					var reg = /[a-zA-Z]/g;
					var attArr = new Array();
					var fid = MD5(filedes[1]);
//						alert(JSON.stringify(fid));
					fid = fid.replace(reg, "");
					fid = fid.substring(0, 5);
					var furl = filedes[1];
					var fname =  filedes[0];
					var fsize = data.size;
					var attObjc = {
						id : fid,
						url : furl,
						size : fsize,
						name : fname
					};
				attArr.push(attObjc);
//				alert(JSON.stringify(attArr));
				//					$('#attachmentTableView').html('');
				saveAttDatasToDb(attArr, '#teacher_attachmentTableView');
			}
		}
		 function listImg(data){
		 if(data == undefined || data == null || data == '' ){
		return;
		}
		  var imageHtmls = '';
		 for(var i=0;i<data.length;i++){
		 var imageHtml= '<div class="CellFrame">'+
						'<img class="picCell" src='+data[i]+' onClick="showimg('+ "'" +data[i]+ "'"+"," + 0 +')">'+
					'</div>';
		 imageHtmls = imageHtmls + imageHtml;
		 }
		$("#addPhoto").html(imageHtmls);
		}
		//描述
			function openbewrite(){
			api.openWin({useWKWebView:true,
			    name: 'Student_Free_bewrite',
			    url: '../Study/Student_Free_bewrite.html',
			    pageParam: {
			        title : pageParam.title,
					bewrite : api.pageParam.bewrite,
					is_dis_bewrite : api.pageParam.is_dis_bewrite
			    }
			});
		}
		function backClick(){
		sendBuriedNotifi(1, '作业章节详情页', '070');
		 api.closeWin({
         });
         
		}
	</script>
</html>